package com.huarui.purchaseOrder.dao;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import org.ewaf.framework.dao.IBaseDao;

import com.huarui.purchaseOrder.model.PurOrSaleOrderDetail;

public interface IPurchaseOrderDetailDao extends IBaseDao {
//	public List<Map<String, String>> getPurchaseOrderDetailsByCode(String code);

//	public List<Map<String, String>> getPurchaseOrderDetailsByComplex(
//			Map<String, String> pm);

//	public List<PurOrSaleOrderDetail> getPurchaseOrderDetailsByMap(Map map);

	List<Map<String, String>> getPurchaseOrderDetailByOrderIdJson(Integer id);
	
	/**
	 * 查询某个订单所有明细数据
	 */
	public List<PurOrSaleOrderDetail> getPurchaseOrderDetailsByOrderId(Integer id);

	/**
	 * 查询订单某条明细数据
	 * @param id
	 * @return
	 */
	public PurOrSaleOrderDetail getPurchaseOrderDetailsById(Integer id);

	/**
	 * 根据订单号计算出总金额
	 * @param ordersId
	 * @return
	 */
	public BigDecimal getAmountByOrdersId(Integer ordersId);
	
	/**
	 * 批量增加明细
	 * @param list
	 * @return
	 */
	public Integer addBatch(final List<PurOrSaleOrderDetail> list);

	/**
	 * 批量更新明细
	 * @param list
	 * @return
	 */
	public Integer updateBatch(final List<PurOrSaleOrderDetail> list);

	/**
	 * 批量删除明细
	 * @param idList
	 * @return
	 */
	public Integer delBatch(List<Integer> idList);

	/**
	 * 根据订单号删除所有明细数据
	 * @param ordersId
	 */
	public void delDetailsByOrderId(Integer ordersId);

	/**
	 * 根据map参数返回订单目录,关联字典表 xu
	 * 
	 * @param map
	 * @return
	 */
	public List<Map<String, Object>> getOrderItems(Map<String, Object> map);

	/**
	 * 明细分页数据信息
	 * 
	 * @param map
	 * @return
	 */
	public List<Map<String, Object>> getPurDetailsInfoByComplex(Map<String, Object> map);

	/**
	 * 查询明细数据量
	 * 
	 * @param map
	 * @return
	 */
	public Integer getPurDetailsCountByComplex(Map<String, Object> map);

	/**
	 * 查询明细订单ID集合
	 * 
	 * @param orderId
	 * @return
	 */
	public List<Integer> getDetailsIdsByOrderId(Integer orderId);

}
